from enum import Enum, IntEnum


class SexType(IntEnum):
    unknown = (0, '未知')
    men = (1, '男')
    women = (2, '女')

    def __new__(cls, value: int, desc: str):
        obj = int.__new__(cls)
        obj._value_ = value
        obj.desc = desc
        return obj


class DataScopeType(IntEnum):
    ALL = (1, "全部数据权限")
    CUSTOM = (2, "自定义数据权限")
    DEPT_AND_CHILD = (3, "本部门及以下数据权限")
    DEPT_ONLY = (4, "本部门数据权限")
    SELF = (5, "仅本人数据权限")

    def __new__(cls, value: int, desc: str):
        obj = int.__new__(cls)
        obj._value_ = value
        obj.desc = desc
        return obj


class MenuType(IntEnum):
    OTHER = (0, "其他")
    MENU = (1, "菜单")
    PAGE = (2, "页面")
    BUTTON = (3, "按钮")

    def __new__(cls, value: int, desc: str):
        obj = int.__new__(cls)
        obj._value_ = value
        obj.desc = desc
        return obj
